<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('用户列表列表')" />
    <th:block th:include="include :: daterangepicker-css" />
    <th:block th:include="include :: select2-css" />


</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>用户ID：</label>
                                <input type="text" name="uid"/>
                            </li>
<!--                            <li>-->
<!--                                <label>手机号：</label>-->
<!--                                <input type="text" name="mobile1" placeholder="模糊手机号搜索"/>-->
<!--                            </li>-->
                            <li>
                                <label>手机号：</label>
                                <input type="text" name="mobile" placeholder="189****2363/18911112363"/>
                            </li>
                            <li>
                                <label>请求ip：</label>
                                <input type="text" name="reqIp"/>
                            </li>
<!--                            <li>-->
<!--                                <label>运营商：</label>-->
<!--                                <input type="text" name="mobilOperator"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>归属地：</label>-->
<!--                                <input type="text" name="mobileOwnerPlace"/>-->
<!--                            </li>-->
                            <li>
                                <label>渠道名称：</label>
                                <select name="channelCode" class="form-control">
                                    <option value="">所有</option>
                                    <option  th:each="item:${channelCodeList}" th:text="${item.name}" th:value="${item.value}"></option>
                                </select>
                            </li>
                            <li>
                                <label>是否认证：</label>
                                <select name="extInfoFlag" class="form-control">
                                    <option value="">所有</option>
                                    <option  value="1">已认证</option>
                                    <option  value="0">未认证</option>
                                </select>
                            </li>
<!--                            <li>-->
<!--                                <label>用户类型：</label>-->
<!--                                <select name="type" class="form-control">-->
<!--                                    <option value="">所有</option>-->
<!--                                    <option  value="0">正常用户</option>-->
<!--                                    <option  value="1">测试用户</option>-->
<!--                                    <option  value="2">马甲用户</option>-->
<!--                                    <option  value="3">随机用户</option>-->
<!--                                </select>-->
<!--                            </li>-->
                            <li>
                                <label>注册时间：</label>
                                <input type="text" width="150px" id="createTime" name="createTime" autocomplete="off"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="changeExt();"  shiro:hasPermission="member:info:resetExt">
                    <i class="fa fa-plus"></i> 重置认证信息
                </a>
                <a class="btn btn-success" onclick="queryMobie();"  shiro:hasPermission="member:info:queryMobile">
                    <i class="fa fa-desktop"></i> 查询手机号
                </a>
<!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="member:info:edit">-->
<!--                    <i class="fa fa-edit"></i> 修改-->
<!--                </a>-->
<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="member:info:remove">-->
<!--                    <i class="fa fa-remove"></i> 删除-->
<!--                </a>-->
<!--                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="member:info:export">-->
<!--                    <i class="fa fa-download"></i> 导出-->
<!--                </a>-->
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
     <th:block th:include="include :: daterangepicker-js" />
     <th:block th:include="include :: select2-js" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('member:info:edit')}]];
        var removeFlag = [[${@permission.hasPermi('member:info:remove')}]];
        var prefix = ctx + "member/info";
        var prefixView = ctx + "member/info/view/";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/change",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "用户列表",
                striped: true,
                columns: [
                //     {
                //     checkbox: true
                // },
                {
                    field: 'uid',
                    title: 'uid',
                    formatter: function (value,row,index){
                        var result = '<span style="color: #1c84c6; border-bottom: 1px solid " onclick="memberInfoView(\''+row.uid+'\')">'+row.uid+'</span>';
                        return result;
                    }
                },
                {
                    field: 'mobileStr',
                    title: '手机号'
                },
                {
                    field: 'usernameStr',
                    title: '姓名'
                },
                // {
                //     field: 'idCardStr',
                //     title: '身份证号'
                // },
                // {
                //     field: 'mobilOperator',
                //     title: '运营商'
                // },
                // {
                //     field: 'mobileOwnerPlace',
                //     title: '归属地'
                // },
                    {
                        field: 'appName',
                        title: '应用名称'
                    },
                {
                    field: 'channelName',
                    title: '渠道名称'
                },
                {
                    field: 'extInfoFlag',
                    title: '是否认证'
                },
                {
                    field: 'reqIp',
                    title: '注册ip'
                },
                    {
                    field: 'zhimaStr',
                    title: '芝麻'
                },
                    {
                        field: 'resource',
                        title: '来源'
                    },
                    {
                        field: 'platform',
                        title: '平台'
                    },
                // {
                //     field: 'type',
                //     title: '0 正常 1测试账号'
                // },
                // {
                //     field: 'status',
                //     title: '-1 待审核 0 正常  1 锁定'
                // },
                {
                    field: 'createTime',
                    title: '注册时间'
                }
                // ,
                // {
                //     field: 'lastLogintime',
                //     title: '最后登陆时间'
                // }
                // ,
                // {
                //     title: '操作',
                //     align: 'center',
                //     formatter: function(value, row, index) {
                //         var actions = [];
                //         actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.uid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                //         actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.uid + '\')"><i class="fa fa-remove"></i>删除</a>');
                //         return actions.join('');
                //     }
                // }
                ]
            };
            $.table.init(options);

            // layui.use('laydate', function(){
            //     var laydate = layui.laydate;
            //
            //     laydate.render({
            //         elem: '#createTime',
            //         type: 'datetime',
            //         range: '~'
            //     });
            // });
        });

        $('#createTime').daterangepicker({
                "timePicker": true,
                "timePicker24Hour": true,
                "timePickerSeconds": true,
                "locale": {
                    "direction": "ltr",
                    "format": "YYYY-MM-DD HH:mm:ss",
                    "separator": " ~ ",
                    "applyLabel": "确定",
                    "cancelLabel": "取消",
                    "daysOfWeek": [ "七", "一", "二", "三", "四", "五", "六"],
                    "monthNames": ["1","2","3","4","5","6","7","8","9","10","11","12"
                    ],
                    // "firstDay": 1
                }
            },function (){}
        );

        function memberInfoView(uid){
            var url = prefixView + uid;
            $.modal.open('用户详情', url);
        }

        function changeExt(){
            var url = prefix + '/change';
            $.modal.open('修改认证信息', url);
        }

        function queryMobie(){
            var url = prefix + '/queryMobile';
            $.modal.open('查询手机号', url);
        }

    </script>

</body>
</html>